using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WallNut : Plants
{
    Animator animator;
    private void Start()
    {
        animator = GetComponent<Animator>();
    }

    private void Update()
    {
        //获取血量
        float currentHealth = GetComponent<Character>().currentHealth;
        float maxHealth = GetComponent<Character>().maxHealth;
        animator.SetFloat("percentage", currentHealth / maxHealth);
    }
}
